###从layuiAdminPro上的完整分页功能改的

###参数分别是：总记录数、当前页、总页数、跳转连接
#define paginate(totalRow, currentPage, totalPage, link)
	#if(totalPage < 2 || currentPage > totalPage)
		#return
	#end
	
	#setLocal(startPage = currentPage - 2)
	#if(startPage < 2)
		#setLocal(startPage = 2)
	#end
	#setLocal(endPage = currentPage + 2)
	#if(endPage > (totalPage-1))
		#setLocal(endPage = (totalPage-1))
	#end
	
	<div class="layui-box layui-laypage layui-laypage-default">
		<span class="layui-laypage-count">共 #(totalRow) 条</span>
		#if(currentPage==1)
		<a href="javascript:;" class="layui-laypage-prev layui-disabled">上一页</a>
		<span class="layui-laypage-curr">
			<em class="layui-laypage-em"></em>
			<em>1</em>
		</span>
		#else
		<a href="#(link)#(currentPage-1)#(append)" class="layui-laypage-prev pjax-a">上一页</a>
		<a href="#(link)1#(append)" class="pjax-a">1</a>
		#end
		
		#if(startPage>2)
		<span class="layui-laypage-spr">…</span>
		#end
		
		#if(endPage>=startPage)
			#for(i : [startPage..endPage])
				#if(currentPage == i)
					<span class="layui-laypage-curr">
						<em class="layui-laypage-em"></em>
						<em>#(i)</em>
					</span>
				#else
					<a href="#(link)#(i)#(append)" class="pjax-a">#(i)</a>
				#end
			#end
		#end
		
		#if(endPage<totalPage-1)
		<span class="layui-laypage-spr">…</span>
		#end
		
		#if(currentPage==totalPage)
		<span class="layui-laypage-curr">
			<em class="layui-laypage-em"></em>
			<em>#(totalPage)</em>
		</span>
		<a href="javascript:;" class="layui-laypage-next layui-disabled" data-page="2">下一页</a>
		#else
		<a href="#(link)#(totalPage)#(append)" class="layui-laypage-last pjax-a" title="尾页">#(totalPage)</a>
		<a href="#(link)#(currentPage+1)#(append)" class="layui-laypage-next pjax-a">下一页</a>
		#end
	</div>
#end